package com.zy.web.demo.duoxiancheng.demo18;

/**
 * @author <a href="mailto:zhouyong@cqyyt.com">zy</a>
 * @version 1.0
 * @date 2020/8/19 14:02
 */
public class Method18 {

    public void testMethod(Object lock){
        try {
            synchronized (lock){
                System.out.println("begin 线程名称="+Thread.currentThread().getName());
                lock.wait();
                System.out.println("end 线程名称="+Thread.currentThread().getName());
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

}
